<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../common/header.jsp"%>
<div class="clearfix"></div>
<div class="row">
	<div class="col-md-12">
		<div class="x_panel">
			<div class="x_title">
				<h2>
					APP版本管理维护 <i class="fa fa-user"></i>
				</h2>
				<div class="clearfix"></div>
			</div>
		</div>
	</div>
	<div class="col-md-12 col-sm-12 col-xs-12">
		<div class="x_panel">
			<div class="x_content">
				<p class="text-muted font-13 m-b-30"></p>
				<div id="datatable-responsive_wrapper"
					class="dataTables_wrapper form-inline dt-bootstrap no-footer">
					<div class="row">
						<div class="col-sm-12">
							<table id="datatable-responsive"
								class="table table-striped table-bordered dt-responsive nowrap dataTable no-footer dtr-inline collapsed"
								cellspacing="0" width="100%" role="grid"
								aria-describedby="datatable-responsive_info"
								style="width: 100%;">
								<thead>
									<tr role="row">
										<th>软件名称</th>
										<th>软件大小(单位:M)</th>
										<th>状态</th>
										<th>版本名称</th>
										<th>版本号</th>
										<th>创建时间</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach var="appVersion"
										items="${appVersionDto.appVersionList}" varStatus="status">
										<tr role="row" class="odd">
											<td>${appVersionDto.appName }</td>
											<td>${appVersion.size }</td>
											<td><c:choose>
													<c:when test="${appVersion.status==0 }">待审核</c:when>
													<c:when test="${appVersion.status==1 }">审核通过</c:when>
													<c:when test="${appVersion.status==2 }">已上架</c:when>
													<c:when test="${appVersion.status==3 }">已下架</c:when>
													<c:when test="${appVersion.status==4 }">审核未通过</c:when>
												</c:choose></td>
											<td>${appVersion.versionName }</td>
											<td>${appVersion.versionCode }</td>
											<td><fmt:formatDate value="${appVersion.createTime }"
													pattern="yyyy-MM-dd HH:mm:ss" /></td>
											<td>
												<div class="btn-group">
													<button type="button" class="btn btn-danger">点击操作</button>
													<button type="button"
														class="btn btn-danger dropdown-toggle"
														data-toggle="dropdown" aria-expanded="false">
														<span class="caret"></span> <span class="sr-only">Toggle
															Dropdown</span>
													</button>
													<ul class="dropdown-menu" role="menu">
														<li><c:choose>
																<c:when
																	test="${appVersion.status == 2 || appVersion.status == 4}">
																	<a class="saleSwichOpen" saleSwitch="open"
																		data-toggle="tooltip" data-placement="left" title=""
																		data-original-title="恭喜您，您的审核已经通过，您可以点击上架发布您的APP">上架</a>
																</c:when>
																<c:when test="${appVersion.status == 3}">
																	<a class="saleSwichClose" saleSwitch="close"
																		data-toggle="tooltip" data-placement="left" title=""
																		data-original-title="您可以点击下架来停止发布您的APP，市场将不提供APP的下载">下架</a>
																</c:when>
															</c:choose></li>
														<li><a class="deleteVersion" data-toggle="tooltip"
															data-placement="left" title=""
															data-original-title="删除该版本" 
															versionId="${appVersion.id }"
															appId="${appVersionDto.appId }"
															status="${appVersion.status }">删除</a></li>
													</ul>
												</div>
											</td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<%@include file="../common/footer.jsp"%>
<script src="${pageContext.request.contextPath }/statics/localjs/rollpage.js"></script>
<!-- 获取app版本列表所用到的juqery代码 -->
<script src="${pageContext.request.contextPath }/statics/localjs/appversionlist.js"></script>
